#ifndef VENUS_SHADOW_VOLUME_SHADOW_VOLUME_DEMO_H
#define VENUS_SHADOW_VOLUME_SHADOW_VOLUME_DEMO_H

#include "ui/glut_window.h"
#include "graphics/camera.h"
#include "graphics/fps_counter.h"
#include "nvModel/nvModel.h"

namespace venus {
class SilhouetteDemo : public GlutWindow {
public:
  SilhouetteDemo(); 
  ~SilhouetteDemo();
  bool Initialize();
  void OnIdle();
  void OnDisplay();
  void OnResize(int width, int height);
  void OnKeyboard(unsigned char key, int x, int y);
  void OnSpecialKey(int key, int x, int y);
private:
  void RenderSkyBox();
  void RenderScene();
  void UpdateLight(int i);
  void ShadowPass();
  void IntializeResources();
  void ReleaseResources();
  void LoadShaders();
  void UpdateDepthMap();
  void DrawModel();
private:
  OrbitPerspectiveCameraGL camera_;
  FpsCounter fps_counter_;
  ProgramGLSL *silhouette_program_;
  GLint depth_tex_var_;
  nv::Model *model_;
  FramebufferObject *fbo_;
  ImageTextureGL *depth_tex_;
  int render_method_;
};
} // namespace venus

#endif // VENUS_SHADOW_VOLUME_SHADOW_VOLUME_DEMO_H
